<template>
  <div class="lg_bg">
    <div class="lg_box">
      <Row>
        <Col span="14" class="lg_box_left">
          <div class="lg_box_left_mb"></div>
          <h1 class="lg_box_left_title">声誉风险智能防控平台</h1>
          <div class="lg_box_left_hr"></div>
          <div class="lg_box_left_subtitle">
            <div>欢迎登陆</div>
            <div>舆情企业版——声誉风险智能防控平台</div>
          </div>
        </Col>
        <Col span="10" class="lg_box_right">
          <div class="lg_box_right_box">
            <Row type="flex" align="bottom" class="right_box_denglu">
              <Col span="4">
                <h2>登录</h2>
              </Col>
              <Col span="10" push="10">
                没有账号？
                <a href="#">点此登录</a>
              </Col>
            </Row>
            <Form ref="formValidate" :model="formValidate" :rules="ruleValidate">
              <FormItem prop="name">
                <Input v-model="formValidate.name" placeholder="手机或邮箱"></Input>
              </FormItem>
              <FormItem prop="password">
                <Input v-model="formValidate.password" placeholder="密码"></Input>
              </FormItem>
            </Form>
            <Row style="margin-bottom:2vh;">
              <Col span="8">
                <Checkbox v-model="single">记住我</Checkbox>
              </Col>
              <Col span="7" push="9">
                <a href>短信验证码登录</a>
              </Col>
            </Row>
            <Row>
              <Button type="primary" long @click="handleSubmit('formValidate')">登录</Button>
            </Row>
            <Divider style="font-size:10px;margin-top:3vh;">其他方式登录</Divider>
            <Row type="flex" justify="space-between">
              <Col span="4">
                <div style="height:3.5vh;">
                  <img :src="loginImg.QQ" alt class="login_img" />
                </div>

                <div class="login_img_name">QQ</div>
              </Col>
              <Col span="4">
                <div style="height:3.5vh;">
                  <img :src="loginImg.wechat" alt class="login_img" />
                </div>

                <div class="login_img_name">微信</div>
              </Col>
              <Col span="4">
                <div style="height:3.5vh;">
                  <img :src="loginImg.weibo" alt class="login_img" />
                </div>

                <div class="login_img_name_weibo">微博</div>
              </Col>
            </Row>
          </div>
        </Col>
      </Row>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      formValidate: {
        name: "",
        password: ""
      },
      ruleValidate: {
        name: [{ required: true, message: "请输入账号", trigger: "blur" }],
        password: [{ required: true, message: "请输入密码", trigger: "blur" }]
      },
      single: false,
      loginImg: {
        QQ: "",
        wechat: "",
        weibo: ""
      }
    };
  },
  methods: {
    handleSubmit(name) {
      this.$refs[name].validate(valid => {
        if (valid) {
          this.$Message.success("Success!");
        } else {
          this.$Message.error("Fail!");
        }
      });
    }
  },
  created() {
    this.loginImg.QQ = require("../assets/IMG/QQ.png");
    this.loginImg.wechat = require("../assets/IMG/wechat.png");
    this.loginImg.weibo = require("../assets/IMG/weibo.png");
  }
};
</script>

<style scoped>
.lg_bg {
  width: 100%;
  height: 100vh;
  background-image: url(../assets/IMG/login_bg.jpg);
}
.lg_box {
  height: 700px;
  width: 1200px;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 50px rgb(3, 14, 77);
}
.lg_box_left {
  background-image: url(../assets/IMG/login_s_bg.png);
  height: 700px;
}
.lg_box_left_mb {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: linear-gradient(
    to right,
    rgb(9, 42, 112),
    rgba(17, 54, 134, 0.171)
  );
}
.lg_box_right {
  background: #fff;
  height: 700px;
}
.lg_box_left_title {
  color: #fff;
  position: absolute;
  left: 10%;
  top: 20vh;
}
.lg_box_left_hr {
  width: 5%;
  position: absolute;
  top: 25vh;
  left: 10%;
  border-bottom: solid rgb(255, 255, 255) 5px;
}
.lg_box_left_subtitle {
  width: 50;
  position: absolute;
  top: 27vh;
  left: 10%;
  color: rgba(255, 255, 255, 0.774);
}
.lg_box_right_box {
  width: 100%;
  height: 100%;
  padding: 20vh 15%;
}
.right_box_denglu {
  margin-bottom: 2vh;
}
.login_img {
  width: 50%;
}
.login_img:hover {
  cursor: pointer;
  transform: scale(1.2, 1.2);
  transition: 0.3s all;
}
.login_img_name {
  font-size: 10px;
  margin-left: 6%;
}
.login_img_name_weibo {
  font-size: 10px;
}
</style>
